﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Wala.Common.Contact
{
    public class ContactGroup : INotifyPropertyChanged
    {
        #region //-------- Private Fields ---------//
        public event PropertyChangedEventHandler PropertyChanged;

        private string contactGroupName;

        private ulong groupChatID;

        string memberIds;

        #endregion

        #region //---------- CLR Properties ----------//
        
        public string ContactGroupName
        {
            get { return contactGroupName; }
            set
            {
                if (this.contactGroupName != value)
                {
                    this.contactGroupName = value;
                    OnPropertyChanged("ContactGroupName");
                }
            }
        }

        public ulong GroupChatID
        {
            get { return groupChatID; }
            set
            {
                if (this.groupChatID != value)
                {
                    this.groupChatID = value;
                    OnPropertyChanged("GroupChatID");
                }
            }
        }

        public string MemberIds
        {
            get { return memberIds; }
            set
            {
                if (this.memberIds != value)
                {
                    this.memberIds = value;
                    OnPropertyChanged("MemberIds");
                }
            }
        }

        #endregion

        #region //----------- Constructor ----------//

        public ContactGroup()
        {
            contactGroupName = "";
            groupChatID = 0;
            memberIds = "";
        }

        public ContactGroup(string contactGroupName, ulong groupChatID, string memberIds)
        {
            this.contactGroupName = contactGroupName;
            this.groupChatID = groupChatID;
            this.memberIds = memberIds;
        }

        #endregion

        #region //----------- Protect Methods ----------//

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
